<!---
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

<html>
    <head>
        <meta charset="utf-8">
        <title>Apache Yetus</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <link href="/assets/css/bootstrap.css" rel="stylesheet">
        <link href="/assets/css/bootstrap-theme.css" rel="stylesheet">
                    <link href="/assets/css/font-awesome.css" rel="stylesheet">

        <!-- JS -->
        <script type="text/javascript" src="/assets/js/jquery-2.1.4.min.js"></script>
        <script type="text/javascript" src="/assets/js/bootstrap.js"></script>
  </head>
    <body>
      <div class="navbar navbar-inverse navbar-static-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="img-responsive pull-left" href="/">
                <img style="max-height: 40px; margin-top: 5px; margin-bottom: 5px;" src="/assets/img/yetus_logo.png" alt="Apache Yetus logo" />
            </a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li><a href="/downloads/">Downloads</a>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">Documentation <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                      <li><a href="/documentation/0.1.0/">Docs for v0.1.0</a></li>
                      <li><a href="/documentation/0.2.0/">Docs for v0.2.0</a></li>
                      <li><a href="/documentation/0.2.1/">Docs for v0.2.1</a></li>
                      <li><a href="/documentation/0.3.0/">Docs for v0.3.0</a></li>
                      <li><a href="/documentation/in-progress/">In Progress Docs for Contributors</a>
                      </li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">Get Involved <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="drop1">
                        <li role="presentation"><a role="menuitem" tabindex="-1" href="/mailinglists"><i class="fa fa-commenting"></i> Mailing Lists</a>
                        </li>
                        <li role="presentation"><a role="menuitem" tabindex="-1" href="http://issues.apache.org/jira/browse/YETUS"><i class="fa fa-bug"></i> JIRA (Bugs)</a>
                        </li>
                        <li role="presentation"><a role="menuitem" tabindex="-1" href="https://git-wip-us.apache.org/repos/asf?s=yetus"><i class="fa fa-code"></i> Source (Apache)</a>
                        </li>
                        <li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/apache/yetus"><i class="fa fa-github-alt"></i> Source (GitHub)</a>
                        </li>
                        <li role="presentation"><a role="menuitem" tabindex="-1" href="/contribute/"><i class="fa fa-code-fork"></i> Contributing</a>
                        </li>
                        <li role="presentation"><a role="menuitem" tabindex="-1" href="https://twitter.com/ApacheYetus"><i class="fa fa-twitter"></i> @ApacheYetus</a>
                        </li>
                    </ul>
                </li>
                <li>
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">Apache Software Foundation <b class="caret"></b></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="http://www.apache.org">Apache Homepage</a>
                            </li>
                            <li><a href="http://www.apache.org/licenses/">Apache License</a>
                            </li>
                            <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
                            </li>
                            <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a>
                            </li>
                            <li><a href="http://www.apache.org/security/">Security</a>
                            </li>
                        </ul>
                    </li>
                </li>
            </ul>
        </div>
        <!--/.nav-collapse -->
    </div>
</div>

      <div class="container">
        <!---
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

<h1 id="releasedocmaker">releasedocmaker</h1>

<ul>
<li><a href="#purpose">Purpose</a></li>
<li><a href="#requirements">Requirements</a></li>
<li><a href="#basic-usage">Basic Usage</a></li>
<li><a href="#changing-the-header">Changing the Header</a></li>
<li><a href="#multiple-versions">Multiple Versions</a></li>
<li><a href="#unreleased-dates">Unreleased Dates</a></li>
<li><a href="#sorted-output">Sorted Output</a></li>
<li><a href="#backward-incompatible-changes">Backward Incompatible Changes</a></li>
<li><a href="#lint-mode">Lint Mode</a></li>
<li><a href="#index-mode">Index Mode</a></li>
<li><a href="#release-version">Release Version</a></li>
</ul>

<h1 id="purpose">Purpose</h1>

<p>Building changelog information in a form that is human digestible but still containing as much useful information is difficult.  Many attempts over the years have resulted in a variety of methods that projects use to solve this problem:</p>

<ul>
<li>JIRA-generated release notes from the <q>Release Notes</q> button</li>
<li>Manually modified CHANGES file</li>
<li>Processing git log information</li>
</ul>

<p>All of these methods have their pros and cons.  Some have issues with accuracy.  Some have issues with lack of details. None of these methods seem to cover all of the needs of many projects and are full of potential pitfalls.</p>

<p>In order to solve these problems, releasedocmaker was written to automatically generate a changelog and release notes by querying Apache&rsquo;s JIRA instance.</p>

<h1 id="requirements">Requirements</h1>

<ul>
<li>Python 2.6 with dateutil extension</li>
</ul>

<p>dateutil may be installed via pip:  <code>pip install python-dateutil</code></p>

<h1 id="basic-usage">Basic Usage</h1>

<p>Minimally, the name of the JIRA project and a version registered in JIRA must be provided:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project <span class="o">(</span>project<span class="o">)</span> --version <span class="o">(</span>version<span class="o">)</span>
</code></pre>

<p>This will query Apache JIRA, generating two files in a directory named after the given version in an extended markdown format which can be processed by both mvn site and GitHub.</p>

<ul>
<li>CHANGES.(version).md</li>
</ul>

<p>This is similar to the JIRA <q>Release Notes</q> button but is in tabular format and includes the priority, component, reporter, and contributor fields.  It also highlights Incompatible Changes so that readers know what to look out for when upgrading. The top of the file also includes the date that the version was marked as released in JIRA.</p>

<ul>
<li>RELEASENOTES.(version).md</li>
</ul>

<p>If your JIRA project supports the release note field, this will contain any JIRA mentioned in the CHANGES log that is either an incompatible change or has a release note associated with it.  If your JIRA project does not support the release notes field, this will be the description field.</p>

<p>For example, to build the release documentation for HBase v1.2.0&hellip;</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project HBASE --version 1.2.0
</code></pre>

<p>&hellip; will create a 1.2.0 directory and inside that directory will be CHANGES.1.2.0.md and RELEASENOTES.1.2.0.md .</p>

<p>By default, release notes are expected to be in plain text.  However, you can write them in markdown if you include a header at the top of your release note:</p>
<pre class="highlight xml"><code><span class="c">&lt;!-- markdown --&gt;</span>
remaining text
</code></pre>

<h1 id="changing-the-header">Changing the Header</h1>

<p>By default, it will use a header that matches the project name.  But that is kind of ugly and the case may be wrong.  Luckily, the title can be changed:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project HBASE --version 1.2.0 --projecttitle <span class="s2">"Apache HBase"</span>
</code></pre>

<p>Now instead of <q>HBASE</q>, it will use <q>Apache HBASE</q> for some titles and headers.</p>

<h1 id="multiple-versions">Multiple Versions</h1>

<p>The script can also generate multiple versions at once, by</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project HBASE --version 1.0.0 --version 1.2.0
</code></pre>

<p>This will create the files for versions 1.0.0 and versions 1.2.0 in their own directories.</p>

<p>But what if the version numbers are not known?  releasedocmaker can also generate version data based upon ranges:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project HBASE --version 1.0.0 --version 1.2.0 --range
</code></pre>

<p>In this form, releasedocmaker will query JIRA, discover all versions that alphabetically appear to be between 1.0.0 and 1.2.0, inclusive, and generate all of the relative release documents.  This is especially useful when bootstrapping an existing project.</p>

<h1 id="unreleased-dates">Unreleased Dates</h1>

<p>For released versions, releasedocmaker will pull the date of the release from JIRA.  However, for unreleased versions it marks the release as <q>Unreleased</q>. This can be inconvenient when actually building a release and wanting to include it inside the source package.</p>

<p>The &ndash;usetoday option can be used to signify that instead of using Unreleased, releasedocmaker should use today&rsquo;s date.</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project HBASE --version 1.0.0 --usetoday
</code></pre>

<p>After using this option and release, don&rsquo;t forget to change JIRA&rsquo;s release date to match!</p>

<h1 id="sorted-output">Sorted Output</h1>

<p>Different projects may find one type of sort better than another, depending upon their needs.  releasedocmaker supports two types of sorts and each provides two different options in the direction for that sort.</p>

<h2 id="resolution-date-base-sort">Resolution Date-base Sort</h2>

<p>By default, releasedocmaker will sort the output based upon the resolution date of the issue starting with older resolutions.  This is the same as giving these options:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project falcon --version 0.6 --sorttype resolutiondate --sortorder older
</code></pre>

<p>The order can be reversed so that newer issues appear on top by providing the &lsquo;newer&rsquo; flag:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project falcon --version 0.6 --sorttype resolutiondate --sortorder newer
</code></pre>

<p>In the case of multiple projects given on the command line, the projects will be interspersed.</p>

<h2 id="issue-number-based-sort">Issue Number-based Sort</h2>

<p>An alternative to the date-based sort is to sort based upon the issue id.  This may be accomplished via:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project falcon --version 0.6 --sorttype issueid --sortorder asc
</code></pre>

<p>This will now sort by the issue id, listing them in lowest to highest (or ascending) order.</p>

<p>The order may be reversed to list them in highest to lowest (or descending) order by providing the appropriate flag:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project falcon --version 0.6 --sorttype issueid --sortorder desc
</code></pre>

<p>In the case of multiple projects given on the command line, the projects will be grouped and then sorted by issue id.</p>

<h1 id="backward-incompatible-changes">Backward Incompatible Changes</h1>

<p>To check if an issue is backward-incompatible the releasedocmaker script first checks the <q>Hadoop Flags</q> field in the
issue. If this field is found to be blank then it searches for the &#39;backward-incompatible&rsquo; label. You can override the
default value for this label by using &ndash;incompatiblelabel option e.g.</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project falcon --version 0.6 --incompatiblelabel not-compatible
</code></pre>

<p>or equivalently using the shorter -X option</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project falcon --version 0.6 -X not-compatible
</code></pre>

<h1 id="lint-mode">Lint Mode</h1>

<p>In order to ensure proper formatting while using mvn site, releasedocmaker puts in periods (.) for fields that are empty or unassigned.  This can be unsightly and not proper for any given project.  There are also other things, such as missing release notes for incompatible changes, that are less than desirable.</p>

<p>In order to help release managers from having to scan through potentially large documents, releasedocmaker features a lint mode, triggered via &ndash;lint:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py --project HBASE --version 1.0.0 --lint
</code></pre>

<p>This will do the normal JIRA querying, looking for items it considers problematic.  It will print the information to the screen and then exit with either success or failure, depending upon if any issues were discovered.</p>

<h1 id="index-mode">Index Mode</h1>

<p>There is basic support for an autoindexer.  It will create two files that contain links to all directories that have a major.minor*-style version numbering system.
For example directories with names like 0.6, 1.2.2, 1.2alpha etc. will all be linked.</p>

<ul>
<li>index.md: a file suitable for conversion to HTML via mvn site</li>
<li>README.md: a file suitable for display on Github and other Markdown rendering websites</li>
</ul>

<h1 id="release-version">Release Version</h1>

<p>You can find the version of the releasedocmaker that you are using by giving the -V option. This may be helpful in finding documentation for the version you are using.</p>
<pre class="highlight shell"><code><span class="gp">$ </span>releasedocmaker.py -V
</code></pre>

    </div>
      <div class="container">
    <hr>
    <footer class="footer">
        <div class="row-fluid">
            <div class="span12 text-left">
              <div class="span12">
                Copyright 2008-2016 <a href="http://www.apache.org/">Apache Software Foundation</a>. Licensed under the <a href="http://www.apache.org/licenses/">Apache License v2.0</a>. Apache Yetus and the Apache feather logo are trademarks of The Apache Software Foundation.
              </div>
            </div>

        </div>

    </footer>
</div>

  </body>
</html>
